package com.hq.api;


import com.hq.dao.AdminDao;
import com.hq.dao.HomeDao;
import com.hq.pojo.HomePageUtils;
import com.hq.utils.MassageJson;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/HomePage")
public class HomeApi {

    @Resource
    HomeDao homeDao;

    @RequestMapping(value = "/getSatff_Counts",method = RequestMethod.GET)
    public Integer getHomePageInfo(){
        //员工总数
        Integer staff_count = 0;
//111


        try {
            staff_count = homeDao.getStaff_Counts();

            return staff_count;

        } catch (Exception e) {
            e.printStackTrace();
        }

            return staff_count;


    }




//    @RequestMapping("/getAllEarningsMonth")
//    public MassageJsons getAllEarningsMonth(Integer month){
//        List<Earnings> listEarnings = null;
//        try {
//            switch (month){
//                case 1:
//                    listEarnings = earningsDao.getAllEarnings("2020-01-01 00:00:00","2020-01-31 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 2:
//                    listEarnings = earningsDao.getAllEarnings("2020-02-01 00:00:00","2020-02-28 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 3:
//                    listEarnings = earningsDao.getAllEarnings("2020-03-01 00:00:00","2020-03-31 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 4:
//                    listEarnings = earningsDao.getAllEarnings("2020-04-01 00:00:00","2020-04-30 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 5:
//                    listEarnings = earningsDao.getAllEarnings("2020-05-01 00:00:00","2020-05-31 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 6:
//                    listEarnings = earningsDao.getAllEarnings("2020-06-01 00:00:00","2020-06-30 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 7:
//                    listEarnings = earningsDao.getAllEarnings("2020-07-01 00:00:00","2020-07-31 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 8:
//                    listEarnings = earningsDao.getAllEarnings("2020-08-01 00:00:00","2020-08-31 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 9:
//                    listEarnings = earningsDao.getAllEarnings("2020-09-01 00:00:00","2020-09-30 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 10:
//                    listEarnings = earningsDao.getAllEarnings("2020-10-01 00:00:00","2020-10-31 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 11:
//                    listEarnings = earningsDao.getAllEarnings("2020-11-01 00:00:00","2020-11-30 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                case 12:
//                    listEarnings = earningsDao.getAllEarnings("2020-12-01 00:00:00","2020-12-31 23:59:59");
//                    return new MassageJsons("0","请求成功",listEarnings);
//                default:
//                    return new MassageJsons("1","该月份不存在");
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return null;
//    }




}
